package org.erp.common.page;


import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * 列表查询模型
 *
 * @author DongZeLiang
 * @date 2024-11-20 14:18
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class QueryModel<T> {

    /**
     * 当前记录起始索引
     */
    private Integer pageNum;

    /**
     * 每页显示记录数
     */
    private Integer pageSize;

    /**
     * 构建查询分页对象
     * @return 查询分页对象
     */
    public <I> Page<I> buildPage(){
        return Page.of(this.getPageNum(), this.getPageSize());
    }
}

